/*
 * @Author: Bo
 * @Date: 2022-03-23 10:28:28
 */

import http from './axios'

// 获取类型
export const getType = () => {
  return http.request({
    method: 'get',
    url: '/categoty'
  })
}

// 获取博客
export const getBlog = (params: any) => {
  return http.request({
    method: 'get',
    url: '/blog',
    params
  })
}

// 设置博客喜欢
export const setBlogLike = (data: any) => {
  return http.request({
    method: 'post',
    url: '/blog/like',
    data
  })
}

// 获取用户信息
export const getWebmaster = () => {
  return http.request({
    method: 'get',
    url: '/webmaster'
  })
}

// 获取用户信息
export const getUser = (params: Record<string, any>) => {
  return http.request({
    method: 'get',
    url: '/user',
    params
  })
}

// 搜索博客
export const getBlogSearch = (params: Record<string, any>) => {
  return http.request({
    method: 'get',
    url: '/blog/search',
    params
  })
}

export const getBlogDetail = (params: Record<string, any>) => {
  return http.request({
    method: 'get',
    url: '/blog/detail',
    params
  })
}
